//
//  MieHuoQiViewController.m
//  Qihuo
//
//  Created by Cheng Qi on 13-12-12.
//  Copyright (c) 2013年 Vencoo. All rights reserved.
//

#import "MieHuoQiViewController.h"

NSString * gaoqu[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
};

NSString * gaoqu39F[] = {
    @"西侧前室",
};

NSString * gaoqu38F[] = {
    @"东侧前室",
    @"西侧前室",
    @"平台",
    @"东南走道",
};

NSString * diqu1F[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
    @"北侧",
    @"银行区通道",
    @"押款通道",
};

NSString * diqu2F[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
    @"北侧",
    @"动功能厅",
    @"国际会议厅",
    @"东侧走道",
    @"南侧",
};

NSString * diqu3F[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
    @"北侧",
    @"东侧走道",
    @"南侧",
};

NSString * diqu4F[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
    @"北侧",
    @"东侧走道",
    @"南侧",
    @"交易大厅",
};

NSString * diqu5F[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
    @"北侧",
    @"东侧走道",
    @"南侧",
};

NSString * diqu6F[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
    @"北侧",
    @"博物馆东北角",
    @"博物馆东南角",
    @"南侧",
};

NSString * dixia[] = {
    @"东侧前室",
    @"西侧前室",
    @"货梯厅",
    @"东侧",
    @"西侧",
    @"南侧",
    @"北侧",
};


@interface MieHuoQiViewController ()

@end

@implementation MieHuoQiViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
#pragma mark - buttonDelegate
- (void)sureOrCancelDelegate:(UIButton*)btn tag:(NSInteger)tag
{
    UITextField *temperText =(UITextField*)[self.view viewWithTag:8888];//顶部
    UITextField *dateText =(UITextField *)[self.view viewWithTag:8];//中部
    if (tag==0) {
        if (btn.tag == 0) {
            if (_pickerBackView.timeStr.length) {
                temperText.text = _pickerBackView.timeStr ;
            }else{
                NSDateFormatter *fom = [NSDateFormatter new];
                [fom setDateFormat:@"yyyy年MM月dd日"];
                temperText.text = [fom stringFromDate:[NSDate date]];
            }
        }
        _pickerBackView.hidden = YES;
    }
    if (tag==1) {
        if (btn.tag == 0) {
            if (_MiddlePickerBackView.timeStr.length) {
                dateText.text = _MiddlePickerBackView.timeStr ;
            }else{
                NSDateFormatter *fom = [NSDateFormatter new];
                [fom setDateFormat:@"yyyy年MM月dd日"];
                dateText.text = [fom stringFromDate:[NSDate date]];
            }
        }
        _MiddlePickerBackView.hidden = YES;
    }
    self.navigationController.navigationBar.hidden = 0;
   
}

#pragma mark--Resource
-(void)addPickerTimeView
{
    _pickerBackView = [[PickerBackgroundView alloc]initWithFrame:CGRectMake(0, 0, scrennWidth, screenHeight)];
    _pickerBackView.userInteractionEnabled = YES;
    _pickerBackView.butonDelegate = self;
    [_pickerBackView canDate];
    _pickerBackView.tag = 0;
    [self.view addSubview:_pickerBackView];
    _pickerBackView.hidden = YES;
    
    _MiddlePickerBackView = [[PickerBackgroundView alloc]initWithFrame:CGRectMake(0, 0, scrennWidth, screenHeight)];
    _MiddlePickerBackView.userInteractionEnabled = YES;
    _MiddlePickerBackView.butonDelegate = self;
    [_MiddlePickerBackView canDate];
    _MiddlePickerBackView.tag = 1;
    [self.view addSubview:_MiddlePickerBackView];
    _MiddlePickerBackView.hidden=YES;
}
-(void)changeView
{
    UILabel *weatherLabel =[[UILabel alloc]initWithFrame:CGRectMake(10,74,150, 50)];
    weatherLabel.text=@"检查年度:";
    [weatherLabel setTextColor:[UIColor whiteColor]];
    weatherLabel.backgroundColor =[UIColor clearColor];
    [weatherLabel setFont:[UIFont systemFontOfSize:30]];
    UITextField *weatherText =[[UITextField alloc]initWithFrame:CGRectMake(170,74, 200, 50)];
    weatherText.tag=8888;
    NSDateFormatter *dataFormater =[[NSDateFormatter alloc]init];
    [dataFormater setDateFormat:@"yyyy-MM-dd"];
    weatherText.text  = [dataFormater stringFromDate:[NSDate date]];
    [weatherText setTextAlignment:NSTextAlignmentCenter];
    [weatherText setFont:[UIFont systemFontOfSize:25]];
    [weatherText setTextColor:[UIColor whiteColor]];
    weatherText.enabled=NO;
    [weatherText setBorderStyle:UITextBorderStyleLine];
    [self.view addSubview:weatherLabel];
    [weatherLabel release];
    [self.view addSubview:weatherText];
    [weatherText release];
    
    UIButton *btn =[UIButton buttonWithType:UIButtonTypeCustom];//日历
    [btn setBackgroundImage:[UIImage imageNamed:@"日历按钮.png"] forState:UIControlStateNormal];
    btn.frame =CGRectMake(420, 61, 80, 72);
    [self.view addSubview:btn];
    [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    btn.tag=1111;
    
    UIImage *blackImage = [UIImage imageNamed:@"黑底"];
    self.myTableView.frame=CGRectMake(interval111/2, 128, self.myTableView.frame.size.width,screenHeight - blackImage.size.height - 128);
    self.whiteImageView.frame=CGRectMake(self.myTableView.frame.origin.x + self.myTableView.frame.size.width, self.myTableView.frame.origin.y, scrennWidth - (self.myTableView.frame.origin.x)*2 -self.myTableView.frame.size.width, self.myTableView.frame.size.height);
    
    
    self.backScrollV.frame =CGRectMake(10, 10, self.whiteImageView.frame.size.width - 20, self.whiteImageView.frame.size.height - 20);
    NSLog(@"width:%f--height:%f",self.backScrollV.frame.size.width,self.backScrollV.frame.size.height);
    if ([Appinfomation shareIstance].miehuoQuFlag) {
        for (int i = 0; i < 1; i++) {
            UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
            _subView.tag = i;
            _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
            
            UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
            titleLable.text = gaoqu39F[i];
            
            UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
            remarkView.layer.borderWidth = 1;
            
            UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
            [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
            [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
            [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            
            [self.backScrollV addSubview:_subView];
            [subViewArr addObject:_subView];
        }
        self.backScrollV.contentSize = CGSizeMake(0, 495 * 1 +10);
    }
    else
    {
        for (int i = 0; i < 3; i++) {
            UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
            _subView.tag = i;
            _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
            
            UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
            titleLable.text = gaoqu[i];
            
            UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
            remarkView.layer.borderWidth = 1;
            
            UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
            [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
            [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
            [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            
            [self.backScrollV addSubview:_subView];
            [subViewArr addObject:_subView];
        }
        self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
    }
    UIButton *btndd =(UIButton*)[self.blackView viewWithTag:0];
    [btndd setImage:[UIImage imageNamed:@"保存.png"] forState:UIControlStateNormal];
//    _contentView =[[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
//    [self.backScrollV addSubview:_contentView];
    
    
//    UIButton *middleBtn =(UIButton*)[_contentView viewWithTag:2222];
//    [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
//    UIButton *leftChoseBtn =(UIButton*)[_contentView viewWithTag:3333];//正常
//    [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
//    UIButton *rightChoseBtn =(UIButton*)[_contentView viewWithTag:4444];//正常
//    [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view bringSubviewToFront:self.blackGroundV];
//    [self.view bringSubviewToFront:self.blackStopV];
    
//    UITextField *field =(UITextField*)[self.view viewWithTag:8];
//    field.text =[NSString stringWithFormat:@"%@",[NSDate date]];
//    UITextView  *textView =(UITextView*)[self.view viewWithTag:9];
//    [_sendDic setObject:textView.text forKey:@"remark"];
//    
//    [self info];
}
#pragma mark--UITextViewDelegate
-(void)textViewDidEndEditing:(UITextView *)textView
{
    UIView * superView = [textView superview];
    NSDictionary * floorDic = [floorData objectAtIndex:floorNumber];
    NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
    NSMutableDictionary * dic = [checkData objectAtIndex:superView.tag];
    [dic setObject:[textView.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] forKey:@"remark"];
}
#pragma mark---TextFieldDelegate
-(void)textFieldDidEndEditing:(UITextField *)textField
{
//    UIView * superView = [textField superview];
//    NSDictionary * floorDic = [floorData objectAtIndex:floorNumber];
//    NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
//    NSMutableDictionary * dic = [checkData objectAtIndex:superView.tag];
//    switch (textField.tag) {
//            case 9:
//            [dic setObject:textField.text forKey:@"remark"];
//            break;
//        default:
//            break;
//    }
}
#pragma mark---Action
-(void)btnClick:(UIButton*)send
{
    if (send.tag==1111)
    {
        _pickerBackView.hidden=NO;
    }
    switch (send.tag)
    {
        case 1111://上方日历按钮
        {
            UITextField *textField =(UITextField*)[self.view viewWithTag:8888];
            [finanDic setObject:textField.text forKey:@"checkDate"];
            _pickerBackView.hidden=NO;
        }
            break;
        case 2222://中间日历按钮
        {
            UIView * superView = [send superview];
            NSDictionary * floorDic = [floorData objectAtIndex:floorNumber];
            NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
            NSMutableDictionary * dic = [checkData objectAtIndex:superView.tag];
            UITextField *datetextField =(UITextField*)[[send superview] viewWithTag:8];
            [dic setObject:[datetextField.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]forKey:@"checkTime"];
            _MiddlePickerBackView.hidden=NO;
        }
            break;
        case 3333://正常
        {
            UIView * superView = [send superview];
            NSDictionary * floorDic = [floorData objectAtIndex:floorNumber];
            NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
            NSMutableDictionary * dic = [checkData objectAtIndex:superView.tag];
            [send setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
            [dic setObject:@"0" forKey:@"isNormal"];
            UIButton *btn =(UIButton*)[[send superview] viewWithTag:4444];
            [btn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
        }
            break;
        case 4444://不正常
        {
            UIView * superView = [send superview];
            NSDictionary * floorDic = [floorData objectAtIndex:floorNumber];
            NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
            NSMutableDictionary * dic = [checkData objectAtIndex:superView.tag];
            [send setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
            [dic setObject:@"1" forKey:@"isNormal"];
            UIButton *btn =(UIButton*)[[send superview] viewWithTag:3333];
            [btn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
        }
            break;
        default:
            break;
    }
}
//-(void)addDiction
//{
//    _sendDic =[[NSMutableDictionary alloc]initWithCapacity:0];
//}
- (void)viewDidLoad
{
    self.title =@"消火栓巡检";
    [super viewDidLoad];
    floorNumber = 0;

    readyNumber = 0;
    canSend = NO;
    [self loadQuYu];
    [self setAllDic];
    //[self addDiction];
    [self changeView];
    [self addPickerTimeView];
    UITextField *textField =(UITextField*)[self.view viewWithTag:8888];
    [finanDic setObject:textField.text forKey:@"checkTime"];
    NSLog(@"%@",finanDic);
	// Do any additional setup after loading the view.
}

- (void)setAllDic
{
    subViewArr = [[NSMutableArray alloc]init];
    floorData = [[NSMutableArray alloc]init];
    finanDic = [[NSMutableDictionary alloc]initWithObjectsAndKeys:
                [[Appinfomation shareIstance].loginDic objectForKey:@"id"],@"userId",
                nil];
    NSInteger checkID = 0;
    if (![Appinfomation shareIstance].miehuoQuFlag) {
        checkID = 86;
    }

    for (int i = 0; i < self.floorNames.count; i++) {
        NSString * floorID = [NSString stringWithFormat:@"%d",i + 1];
        NSMutableArray * floorCheckDataArr = [[NSMutableArray alloc]init];
        NSString * isNormal = [NSString stringWithFormat:@"%d",0];
        NSString * remark = @"";
        if ([Appinfomation shareIstance].miehuoQuFlag) {
            if (i == 0) {
                for (int i = 0; i < 1; i++) {
                    checkID += 1;
                    NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                    NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                 sendCheckID,@"checkId",
                                                 isNormal,@"isNormal",
                                                 remark,@"remark",
                                                 nil];
                    [floorCheckDataArr addObject:dic];
                }
            }
            else if (i == 1)
            {
                for (int i = 0; i < 4; i++) {
                    checkID += 1;
                    NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                    NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                 sendCheckID,@"checkId",
                                                 isNormal,@"isNormal",
                                                 remark,@"remark",
                                                 nil];
                    [floorCheckDataArr addObject:dic];
                }
            }
            else
            {
                for (int i = 0; i < 3; i++) {
                    checkID += 1;
                    NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                    NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                 sendCheckID,@"checkId",
                                                 isNormal,@"isNormal",
                                                 remark,@"remark",
                                                 nil];
                    [floorCheckDataArr addObject:dic];
                }
            }
            
        }
        else
        {
            switch (i) {
                case 0:
                {
                    for (int i = 0; i < 3; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 1:
                {
                    for (int i = 0; i < 3; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 2:
                {
                    for (int i = 0; i < 3; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 3:
                {
                    for (int i = 0; i < 3; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 4:
                {
                    for (int i = 0; i < 7; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 5:
                {
                    for (int i = 0; i < 6; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 6:
                {
                    for (int i = 0; i < 7; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 7:
                {
                    for (int i = 0; i < 6; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 8:
                {
                    for (int i = 0; i < 8; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 9:
                {
                    for (int i = 0; i < 6; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 10:
                {
                    for (int i = 0; i < 7; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 11:
                {
                    for (int i = 0; i < 7; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                case 12:
                {
                    for (int i = 0; i < 7; i++) {
                        checkID += 1;
                        NSString * sendCheckID = [NSString stringWithFormat:@"%d",checkID];
                        NSMutableDictionary * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                     sendCheckID,@"checkId",
                                                     isNormal,@"isNormal",
                                                     remark,@"remark",
                                                     nil];
                        [floorCheckDataArr addObject:dic];
                    }
                }
                    break;
                default:
                    break;
            }
        }
        NSDictionary * floorDic = [NSDictionary dictionaryWithObjectsAndKeys:
                                   floorID,@"floorId",
                                   floorCheckDataArr,@"checkData",
                                   nil];
        [self.xunJianCellInfos addObject:@{@"hidden":@"1",@"floorId":[floorDic valueForKey:@"floorId"] }];
        [self.floorIds addObject:[floorDic valueForKey:@"floorId"]];
        [floorData addObject:floorDic];
    }
    [finanDic setObject:floorData forKey:@"floorData"];
}

- (void)loadQuYu
{
    switch ([Appinfomation shareIstance].miehuoQuFlag) {
        case 1:
        {
            NSMutableArray *gaoqu = [NSMutableArray arrayWithObjects:
                                    @"39F",
                                    @"38F",
                                    @"37F",
                                    @"36F",
                                    @"35F",
                                    @"34F",
                                    @"33F",
                                    @"32F",
                                    @"31F",
                                    @"30F",
                                    @"29F",
                                    @"28F",
                                    @"27F",
                                    @"26F",
                                    @"25F",
                                    @"24F",
                                    @"23F",
                                    @"22F",
                                    @"21F",
                                    @"20F",
                                    @"19F",
                                    @"18F",
                                    @"17F",
                                    @"16F",
                                    @"15F",
                                    @"14F",
                                    @"13F",
                                    @"12F",
                                    @"11F",
                                    nil];
            self.floorNames = gaoqu;
            self.checkXunJianArea = @"4";
        }
            break;
        case 0:
        {
            NSMutableArray *diqu = [NSMutableArray arrayWithObjects:
                                    @"10F",
                                    @"9F",
                                    @"8F",
                                    @"7F",
                                    @"6F",
                                    @"5F",
                                    @"4F",
                                    @"3F",
                                    @"2F",
                                    @"1F",
                                    @"B1F",
                                    @"B2F",
                                    @"B3F",
                                    nil];
            self.floorNames = diqu;
            self.checkXunJianArea = @"5";
        }
            break;
            
        default:
            break;
    }
    
//    NSURL *sendUrl = [NSURL URLWithString:self.sendUrl];
//    fireProject = [ASIFormDataRequest requestWithURL:sendUrl];
//    fireProject.delegate=self;
//    [fireProject startSynchronous];
//    
//    NSString *response = [fireProject responseString];
//    NSDictionary * result = [response objectFromJSONString];
//    NSMutableArray * dicArr = [result objectForKey:@"data"];
//    NSMutableArray * floorInfoArr = [[NSMutableArray alloc]init];
//    for (int i = 0; i < dicArr.count; i++){
//        NSDictionary * dic = [dicArr objectAtIndex:i];
//        NSString * infoStr = [dic objectForKey:@"floorname"];
//        [floorInfoArr addObject:infoStr];
//    }
//    //高区39-11
//    //地区10-b3
//    
//    self.floorNames = floorInfoArr;
    [self.myTableView reloadData];
    NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0];
    [self.myTableView selectRowAtIndexPath:index animated:YES scrollPosition:UITableViewScrollPositionMiddle];
}

#pragma mark---sendInfo

#pragma mark--Request
-(void)requestFinished:(ASIHTTPRequest *)request
{
    NSLog(@"%@",request.responseString);
}
-(void)requestFailed:(ASIHTTPRequest *)request
{
    NSLog(@"%@",request.responseString);
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (alertView == self.alertV || alertView.tag == 250)
    {
        switch (buttonIndex)
        {
            case 1:
            {
                [[[UIApplication sharedApplication]keyWindow]endEditing:YES];
                [MBProgressHUD showHUDAddedTo:self.view animated:YES];
                if ([alertView textFieldAtIndex:0].text.length == 0) {
                    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告！" message:@"请输入用户名！" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
                    [alert show];
                }else if ([alertView textFieldAtIndex:1].text.length == 0){
                    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告！" message:@"请输入密码！" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
                    [alert show];
                }else{
                    NSURL *loginUrl = [NSURL URLWithString:loginIP];
                    ASIFormDataRequest * loginRequest = [[ASIFormDataRequest alloc] initWithURL:loginUrl];
                    [loginRequest setPostValue:[NSString stringWithFormat:@"%@",[alertView textFieldAtIndex:0].text] forKey:@"user"];
                    [loginRequest setPostValue:[NSString stringWithFormat:@"%@",[alertView textFieldAtIndex:1].text] forKey:@"password"];
                    [loginRequest startSynchronous];
                    NSString *response = [loginRequest responseString];
                    NSDictionary *responseDic = [response JSONValue];
                    NSDictionary *DataDic = [responseDic objectForKey:@"data"];
                    [MBProgressHUD hideHUDForView:self.view animated:YES];
                    if (DataDic == nil) {
                        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告！" message:@"网络无法连接！" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
                        [alert show];
                    }else if ([DataDic isEqual:[NSString stringWithFormat:@"NONE"]]) {
                        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告！" message:@"用户名不存在！" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
                        [alert show];
                    }else if ([DataDic isEqual:[NSString stringWithFormat:@"FAILURE"]]){
                        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告！" message:@"用户密码错误！" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
                        [alert show];
                    }
                    else
                    {
                        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
                        NSString *sendStr =[finanDic JSONRepresentation];
                        NSString * sendUrl;
                        if ([Appinfomation shareIstance].miehuoQuFlag) {
                            sendUrl = MieHuoQiGaoQuUrl;
                        }
                        else
                        {
                            sendUrl = MieHuoQiDiQuUrl;
                        }
                        ASIFormDataRequest *dateForm =[ASIFormDataRequest requestWithURL:[NSURL URLWithString:sendUrl]];
                        dateForm.delegate=self;
                        [dateForm setRequestMethod:@"POST"];
                        [dateForm setPostValue:sendStr forKey:@"data"];
                        [dateForm setDidFinishSelector:@selector(sendFinish:)];
                        [dateForm setDidFailSelector:@selector(sendFail:)];
                        [dateForm startAsynchronous];
                        //[self showAlertSuccess];
                    }
                }
            }
                break;
                
            default:
                
                break;
        }
        
    }
    else if (alertView.tag == 2008)
    {
        [self.navigationController popViewControllerAnimated:YES];
    }

}

- (void)sendFinish:(ASIFormDataRequest *)request
{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
    NSString *response = [request responseString];
    NSDictionary * result = [response objectFromJSONString];
    NSLog(@"%@",result);
    NSString * isSuccess = [result objectForKey:@"data"];
    if ([isSuccess isEqualToString:@"success"]) {
        [self showAlertSuccess];
    }
    else
    {
        [self showAlertFail];
    }
    
}

- (void)sendFail:(ASIFormDataRequest *)request
{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
    [self showAlertFail];
}

- (void)jajajajaj:(UIButton *)btn
{
    switch (btn.tag) {
        case 0:
        {
            if (canSend) {
                [self.alertV textFieldAtIndex:0].text = [[Appinfomation shareIstance].loginDic valueForKey:@"user"];
                [self.alertV show];
                return;
            }
            
            switch ([Appinfomation shareIstance].miehuoQuFlag) {
                case 0:
                {
                    if (floorNumber >= 12) {
                        break;
                    }
                    for (int i = 0; i < subViewArr.count; i++) {
                        UIView * view = [subViewArr objectAtIndex:i];
                        [view removeFromSuperview];
                    }
                    [subViewArr removeAllObjects];
                    self.backScrollV.contentOffset = CGPointMake(0, 0);
                    NSDictionary * floorDic = [floorData objectAtIndex:floorNumber + 1];
                    NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
                    switch (floorNumber) {
                        case 0:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = gaoqu[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                            
                        }
                            break;
                        case 1:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = gaoqu[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                        }
                            break;
                        case 2:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = gaoqu[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                        }
                            break;
                        case 3:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = gaoqu[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                        }
                            break;
                        case 4:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = diqu6F[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                        }
                            break;
                        case 5:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = diqu5F[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 6 +10);
                        }
                            break;
                        case 6:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = diqu4F[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                        }
                            break;
                        case 7:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = diqu3F[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 6 +10);
                        }
                            break;
                        case 8:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = diqu2F[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 8 +10);
                        }
                            break;
                        case 9:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = diqu1F[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 6 +10);
                        }
                            break;
                        case 10:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = dixia[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                        }
                            break;
                        case 11:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = dixia[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                        }
                            break;
                        case 12:
                        {
                            for (int i = 0; i < checkData.count; i++) {
                                NSDictionary * dic = [checkData objectAtIndex:i];
                                
                                UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                                _subView.tag = i;
                                _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                                
                                UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                                titleLable.text = dixia[i];
                                
                                UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                                remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                                remarkView.layer.borderWidth = 1;
                                
                                UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                                [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                                [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                                [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                                
                                if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                }
                                else
                                {
                                    [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                    [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                }
                                
                                [self.backScrollV addSubview:_subView];
                                [subViewArr addObject:_subView];
                            }
                            self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                        }
                            break;
                        default:
                            break;
                    }
                }
                    break;
                case 1:
                {
                    if (floorNumber >= 28) {
                        break;
                    }
                    for (int i = 0; i < subViewArr.count; i++) {
                        UIView * view = [subViewArr objectAtIndex:i];
                        [view removeFromSuperview];
                    }
                    [subViewArr removeAllObjects];
                    self.backScrollV.contentOffset = CGPointMake(0, 0);
                    NSDictionary * floorDic = [floorData objectAtIndex:floorNumber + 1];
                    NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
                    if (floorNumber == 0) {
                        for (int i = 0; i < checkData.count; i++) {
                            NSDictionary * dic = [checkData objectAtIndex:i];
                            
                            UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                            _subView.tag = i;
                            _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                            
                            UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                            titleLable.text = dixia[i];
                            
                            UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                            remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                            remarkView.layer.borderWidth = 1;
                            
                            UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                            [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                            [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                            [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            
                            if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            }
                            else
                            {
                                [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            }
                            
                            [self.backScrollV addSubview:_subView];
                            [subViewArr addObject:_subView];
                        }
                        self.backScrollV.contentSize = CGSizeMake(0, 495 * 1 +10);
                    }
                    else if (floorNumber == 1)
                    {
                        for (int i = 0; i < checkData.count; i++) {
                            NSDictionary * dic = [checkData objectAtIndex:i];
                            
                            UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                            _subView.tag = i;
                            _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                            
                            UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                            titleLable.text = dixia[i];
                            
                            UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                            remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                            remarkView.layer.borderWidth = 1;
                            
                            UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                            [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                            [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                            [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            
                            if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            }
                            else
                            {
                                [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            }
                            
                            [self.backScrollV addSubview:_subView];
                            [subViewArr addObject:_subView];
                        }
                        self.backScrollV.contentSize = CGSizeMake(0, 495 * 4 +10);
                    }
                    else
                    {
                        for (int i = 0; i < checkData.count; i++) {
                            NSDictionary * dic = [checkData objectAtIndex:i];
                            
                            UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                            _subView.tag = i;
                            _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                            
                            UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                            titleLable.text = gaoqu[i];
                            
                            UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                            remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                            remarkView.layer.borderWidth = 1;
                            
                            UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                            [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                            [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                            [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                            
                            if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                                [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                                [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            }
                            else
                            {
                                [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                                [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            }
                            
                            [self.backScrollV addSubview:_subView];
                            [subViewArr addObject:_subView];
                        }
                        self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                    }
                    
                }
                    break;
                default:
                    break;
            }
            
            NSIndexPath *path = [NSIndexPath indexPathForRow:floorNumber inSection:0];
            XunJianCell *cell =(XunJianCell*)[self.myTableView cellForRowAtIndexPath:path];
            if (cell.gouView.hidden) {
                cell.gouView.hidden = NO;
                readyNumber += 1;
                NSString * floorIdStr = [NSString stringWithFormat:@"%d",floorNumber];
                [self.xunJianCellInfos replaceObjectAtIndex:path.row withObject:@{@"hidden": [NSString stringWithFormat:@"0"],@"floorId":floorIdStr}];
            }
            if (![Appinfomation shareIstance].miehuoQuFlag) {
                if (floorNumber < 12) {
                    floorNumber += 1;
                    NSIndexPath *index = [NSIndexPath indexPathForRow:floorNumber inSection:0];
                    [self.myTableView selectRowAtIndexPath:index animated:YES scrollPosition:UITableViewScrollPositionMiddle];
                }
                else
                {
                    floorNumber += 1;
                    NSIndexPath *path = [NSIndexPath indexPathForRow:floorNumber inSection:0];
                    XunJianCell *cell =(XunJianCell*)[self.myTableView cellForRowAtIndexPath:path];
                    if (cell.gouView.hidden) {
                        cell.gouView.hidden = NO;
                        readyNumber += 1;
                        NSString * floorIdStr = [NSString stringWithFormat:@"%d",floorNumber];
                        [self.xunJianCellInfos replaceObjectAtIndex:path.row withObject:@{@"hidden": [NSString stringWithFormat:@"0"],@"floorId":floorIdStr}];
                    }
                }
                UIAlertView *myAlert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"数据保存成功。。。" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
                [myAlert show];
            }
            else
            {
                if (floorNumber < 28) {
                    floorNumber += 1;
                    NSIndexPath *index = [NSIndexPath indexPathForRow:floorNumber inSection:0];
                    [self.myTableView selectRowAtIndexPath:index animated:YES scrollPosition:UITableViewScrollPositionMiddle];
                }
                else
                {
                    floorNumber += 1;
                    NSIndexPath *path = [NSIndexPath indexPathForRow:floorNumber inSection:0];
                    XunJianCell *cell =(XunJianCell*)[self.myTableView cellForRowAtIndexPath:path];
                    if (cell.gouView.hidden) {
                        cell.gouView.hidden = NO;
                        readyNumber += 1;
                        NSString * floorIdStr = [NSString stringWithFormat:@"%d",floorNumber];
                        [self.xunJianCellInfos replaceObjectAtIndex:path.row withObject:@{@"hidden": [NSString stringWithFormat:@"0"],@"floorId":floorIdStr}];
                    }
                }
                UIAlertView *myAlert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"数据保存成功。。。" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
                [myAlert show];
            }
            
            if (![Appinfomation shareIstance].miehuoQuFlag) {
                if (readyNumber == 13) {
                    UIButton *btndd =(UIButton*)[self.blackView viewWithTag:0];
                    [btndd setImage:[UIImage imageNamed:@"提交.png"] forState:UIControlStateNormal];
                    canSend = YES;
                }
            }
            else
            {
                if (readyNumber == 29) {
                    UIButton *btndd =(UIButton*)[self.blackView viewWithTag:0];
                    [btndd setImage:[UIImage imageNamed:@"提交.png"] forState:UIControlStateNormal];
                    canSend = YES;
                }
            }
//            NSLog(@"%@",finanDic);
//            NSString *sendStr =[finanDic JSONRepresentation];
//            NSLog(@"%@",sendStr);
//            NSString * sendUrl;
//            if ([Appinfomation shareIstance].miehuoQuFlag) {
//                sendUrl = MieHuoQiGaoQuUrl;
//            }
//            else
//            {
//                sendUrl = MieHuoQiDiQuUrl;
//            }
//            ASIFormDataRequest *dateForm =[ASIFormDataRequest requestWithURL:[NSURL URLWithString:MieHuoQiGaoQuUrl]];
//            dateForm.delegate=self;
//            [dateForm setRequestMethod:@"POST"];
//            [dateForm setPostValue:sendStr forKey:@"data"];
//            [dateForm startAsynchronous];
//            [self showAlertSuccess];
        }
            break;
        case 1:
        {
            [self.view bringSubviewToFront:self.blackGroundV];
            self.blackGroundV.hidden = 0;
            self.navigationController.navigationBar.hidden = 1;
        }
            break;
        case 2:
        {
            [self.view bringSubviewToFront:self.blackStopV];
            self.blackStopV.hidden = NO;
            self.navigationController.navigationBar.hidden = 1;
        }
            break;
            
        default:
            break;
    }
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView==self.myTableView) {
        return self.leftTableImage.size.height;
    }else
        return 50;
    
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    floorNumber = indexPath.row;
    switch ([Appinfomation shareIstance].miehuoQuFlag) {
        case 0:
        {
            for (int i = 0; i < subViewArr.count; i++) {
                UIView * view = [subViewArr objectAtIndex:i];
                [view removeFromSuperview];
            }
            [subViewArr removeAllObjects];
            self.backScrollV.contentOffset = CGPointMake(0, 0);
            NSDictionary * floorDic = [floorData objectAtIndex:floorNumber];
            NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
            switch (indexPath.row) {
                case 0:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = gaoqu[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                    
                }
                    break;
                case 1:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = gaoqu[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                }
                    break;
                case 2:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = gaoqu[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                }
                    break;
                case 3:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = gaoqu[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
                }
                    break;
                case 4:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = diqu6F[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                }
                    break;
                case 5:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = diqu5F[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 6 +10);
                }
                    break;
                case 6:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = diqu4F[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                }
                    break;
                case 7:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = diqu3F[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 6 +10);
                }
                    break;
                case 8:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = diqu2F[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 8 +10);
                }
                    break;
                case 9:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = diqu1F[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 6 +10);
                }
                    break;
                case 10:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = dixia[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                }
                    break;
                case 11:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = dixia[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                }
                    break;
                case 12:
                {
                    for (int i = 0; i < checkData.count; i++) {
                        NSDictionary * dic = [checkData objectAtIndex:i];
                        
                        UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                        _subView.tag = i;
                        _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                        
                        UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                        titleLable.text = dixia[i];
                        
                        UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                        remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                        remarkView.layer.borderWidth = 1;
                        
                        UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                        [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                        [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                        [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                        
                        if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        }
                        else
                        {
                            [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                            [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        }
                        
                        [self.backScrollV addSubview:_subView];
                        [subViewArr addObject:_subView];
                    }
                    self.backScrollV.contentSize = CGSizeMake(0, 495 * 7 +10);
                }
                    break;
                default:
                    break;
            }
        }
            break;
        case 1:
        {
            for (int i = 0; i < subViewArr.count; i++) {
                UIView * view = [subViewArr objectAtIndex:i];
                [view removeFromSuperview];
            }
            [subViewArr removeAllObjects];
            self.backScrollV.contentOffset = CGPointMake(0, 0);
            NSDictionary * floorDic = [floorData objectAtIndex:floorNumber];
            NSMutableArray * checkData = [floorDic objectForKey:@"checkData"];
            if (indexPath.row == 0) {
                for (int i = 0; i < checkData.count; i++) {
                    NSDictionary * dic = [checkData objectAtIndex:i];
                    
                    UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                    _subView.tag = i;
                    _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                    
                    UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                    titleLable.text = gaoqu39F[i];
                    
                    UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                    remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                    remarkView.layer.borderWidth = 1;
                    
                    UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                    [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                    [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                    [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    
                    if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                        [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                    }
                    else
                    {
                        [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                    }
                    
                    [self.backScrollV addSubview:_subView];
                    [subViewArr addObject:_subView];
                }
                self.backScrollV.contentSize = CGSizeMake(0, 495 * 1 +10);
            }
            else if (indexPath.row == 1)
            {
                for (int i = 0; i < checkData.count; i++) {
                    NSDictionary * dic = [checkData objectAtIndex:i];
                    
                    UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                    _subView.tag = i;
                    _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                    
                    UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                    titleLable.text = gaoqu38F[i];
                    
                    UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                    remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                    remarkView.layer.borderWidth = 1;
                    
                    UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                    [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                    [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                    [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    
                    if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                        [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                    }
                    else
                    {
                        [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                    }
                    
                    [self.backScrollV addSubview:_subView];
                    [subViewArr addObject:_subView];
                }
                self.backScrollV.contentSize = CGSizeMake(0, 495 * 4 +10);
            }
            else
            {
                for (int i = 0; i < checkData.count; i++) {
                    NSDictionary * dic = [checkData objectAtIndex:i];
                    
                    UIView * _subView = [[[NSBundle mainBundle]loadNibNamed:@"MieHuoQi" owner:self options:nil]lastObject];
                    _subView.tag = i;
                    _subView.frame = CGRectMake(0, 495 * i, _subView.frame.size.width, _subView.frame.size.height);
                    
                    UILabel * titleLable = (UILabel *)[_subView viewWithTag:520];
                    titleLable.text = gaoqu[i];
                    
                    UITextView * remarkView = (UITextView *)[_subView viewWithTag:9];
                    remarkView.text = [NSString stringWithString:[[dic objectForKey:@"remark"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];;
                    remarkView.layer.borderWidth = 1;
                    
                    UIButton *middleBtn =(UIButton*)[_subView viewWithTag:2222];
                    [middleBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    UIButton *leftChoseBtn =(UIButton*)[_subView viewWithTag:3333];//正常
                    [leftChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    UIButton *rightChoseBtn =(UIButton*)[_subView viewWithTag:4444];//正常
                    [rightChoseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
                    
                    if ([[dic objectForKey:@"isNormal"]isEqualToString:@"0"]) {
                        [leftChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                        [rightChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                    }
                    else
                    {
                        [leftChoseBtn setImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
                        [rightChoseBtn setImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
                    }
                    
                    [self.backScrollV addSubview:_subView];
                    [subViewArr addObject:_subView];
                }
                self.backScrollV.contentSize = CGSizeMake(0, 495 * 3 +10);
            }
            
        }
            break;
        default:
            break;
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    [super tableView:tableView numberOfRowsInSection:section];
    return [self.floorNames count];

}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
        self.mycell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        if (!self.mycell) {
            self.mycell = [[[NSBundle mainBundle]loadNibNamed:@"XunJianCell" owner:self options:nil] lastObject];
        }
    if (indexPath.row < self.xunJianCellInfos.count) {
        NSDictionary *dic = [self.xunJianCellInfos objectAtIndex:indexPath.row];
        if ([[dic valueForKey:@"hidden"]boolValue] == NO)
        {
            self.mycell.gouView.hidden = NO;
        }
    }

        self.mycell.selectedBackgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"按下"]];
        self.mycell.textLabel.textAlignment = 1;
        self.mycell.backgroundColor = [UIColor clearColor];
        self.mycell.textLabel.textColor = [UIColor whiteColor];
        self.mycell.backgroundView = [[UIImageView alloc]initWithImage:self.leftTableImage];
        self.mycell.textLabel.font = [UIFont systemFontOfSize:35];
        self.mycell.textLabel.backgroundColor = [UIColor clearColor];
        self.mycell.textLabel.text =[self.floorNames objectAtIndex:indexPath.row];
        return self.mycell;

    
}
#pragma mark - keyboardNotification
- (void) keyboardWasShown:(NSNotification *) notif
{
  
}
- (void) keyboardWasHidden:(NSNotification *) notif
{
   
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
